package ms.authority.dao;

import database.MongoBaseDao;
import ms.authority.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.data.mongodb.core.query.Query;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * Project Name: itye
 * File Name: UserDao
 * Package Name: ms.authority.dao
 * Date: 2018/5/3  14:28
 * Copyright (c) 2018, tianyul All Rights Reserved.
 * 用户持久层
 */
@Component
public class UserDao extends MongoBaseDao<User> {
    @Autowired
    private MongoTemplate mongoTemplate;

    public List<User> getList(Class<User> userClass) {
        return mongoTemplate.find(new Query().skip(0).limit(10), User.class);
    }

}
